<html>
    <head>
        <title>电子健康卡</title>
        <script type="text/javascript" src="https://js.aq.qq.com/js/aq_common.js"></script>
        <meta charset="utf-8" />
        <meta name="format-detection" content="telephone=no" />
        <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
        <meta name="mobile-web-app-capable" content="yes" />
        <meta name="apple-mobile-web-app-status-bar-style" content="black-translucent" />
        <link rel="stylesheet" type="text/css" href="/css/base.css" />
        <link rel="stylesheet" type="text/css" href="/css/list.css?v=2" />
    </head>

    <body>
        <div class="wrap">
            <div class="cardlist" id="cardlist"></div>
            <div class="button">
                <div class="addbtn" id="addcard">+ 添加健康卡</div>
                <p class="tips" id="tips"></p>
            </div>
        </div>
    </body>
    <script type="text/javascript" src="/js/common.js"></script>
    <script type="text/javascript" src="/js/jweixin-1.4.0.js"></script>
    <script type="text/javascript" src="/js/jquery.min.js"></script>
    <script type="text/javascript" src="/js/list.js?v=1551248412999"></script>
    <script type="text/javascript">
        $.ajax({
            url: 'https://healthcarddemo.tengmed.com/index.php?c=healthcard&a=getSignPackage',
            data: {
                url: window.location.href
            },
            dataType: 'json',
            type: 'post',
            success: function(res) {
                if (res.retcode === 0) {
                    wx.config({
                        debug: false,
                        appId: res.data.appId,
                        timestamp: res.data.timestamp,
                        nonceStr: res.data.nonceStr,
                        signature: res.data.signature,
                        jsApiList: ['updateAppMessageShareData', 'onMenuShareTimeline', 'onMenuShareAppMessage']
                    });
                }
            }
        });

        wx.ready(function() {
            //需在用户可能点击分享按钮前就先调用
            wx.updateAppMessageShareData(
                {
                    title: '微信服务号电子健康卡个人中心', // 分享标题
                    desc: '微信服务号电子健康卡Demo,功能及页面规范供参考，可提供Demo原代码及素材。', // 分享描述
                    link: 'https://healthcarddemo.tengmed.com/healthcard/list.html', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                    imgUrl: 'https://healthcarddemo.tengmed.com/healthcard/img/icon2.png' // 分享图标
                },
                function(res) {
                    //这里是回调函数
                }
            );

            wx.onMenuShareAppMessage({
                title: '微信服务号电子健康卡个人中心', // 分享标题
                desc: '微信服务号电子健康卡Demo,功能及页面规范供参考，可提供Demo原代码及素材。', // 分享描述
                link: 'https://healthcarddemo.tengmed.com/healthcard/list.html', // 分享链接，该链接域名或路径必须与当前页面对应的公众号JS安全域名一致
                imgUrl: 'https://healthcarddemo.tengmed.com/healthcard/img/icon2.png', // 分享图标
                success: function() {
                    // 用户点击了分享后执行的回调函数
                }
            });
        });
    </script>
</html>
